/**
 * 首页管理
 */
$(function() {

	var questionManageObj = {};
	
	//绑定事件
	initCheckLoginState();
	$('.xinyu-personals').on("click", initUserCenter);
	$('.questionCls').on("click", initQuickQuestion);
	$('.doctorCls').on("click", initFindDoctor);
	$("#go-binding").on('click', initGoBinding);
	
	// 弹窗
	/*function showBindingPop() {
		$(".home-bindingpop").show();
	}
	var BindingPop = function(){
		setTimeout(showBindingPop,3000);
	}*/
	// 点击关闭弹窗
	$('.delete-pop').on("click",function(){
		$(".home-bindingpop").hide();
	});
	function initUserCenter() {
		location.href = "html/userCenter/user-center.html"; //跳转个人中心
	}

	function initFindDoctor() {
		location.href = "html/doctor/make-doctor.html";
	}

	function initQuickQuestion() {
		location.href = "html/service/question-fast.html";
	}
	function initGoBinding() {
		location.href = "html/userCenter/user-phone.html"; //绑定手机号
	}
	//当前用户未登录微信，则重定向服务器端授权
	function initCheckLoginState() {
		//获取openid失败，调整微信授权
		if(OPENID == null) {
			location.replace(serverUrl + "/homepage/oauth?scopeType=1");
		}
	}

});